//
//  Extension+UILabel.swift
//  weibo
//
//  Created by  郭航 on 16/6/27.
//  Copyright © 2016年 郭航. All rights reserved.
//

import UIKit

extension UILabel {
    
    convenience init(textColor: UIColor, textAlignment: NSTextAlignment, font: CGFloat, maxWidth: CGFloat = 0) {
        self.init()
        
        self.textColor = textColor
        self.textAlignment = textAlignment
        self.font = UIFont.systemFontOfSize(font)
        
        if maxWidth > 0 {
            self.preferredMaxLayoutWidth = maxWidth
            self.numberOfLines = 0
        }
    }
    
}
